プロンプトの階層:指示から論理へ
プロンプティングは、単純なコマンドベースの入力から高度な推論アーキテクチャモデルの内部処理経路を導くものに進化しました。
基本概念
- ゼロショットプロンプティング:例なしでタスクの説明を与える(例:「これをフランス語に翻訳してください」)
- フェイショットプロンプティング:「デモ」(入力-出力ペア)を使ってラベル空間と望ましい形式を定義する
- チェーン・オブ・シンキング(CoT):モデルが中間的な推論ステップを生成するように促すプロンプティング技法
- 出現的特性:複雑な推論は明示的にプログラムされていないが、通常100億パラメータを超えるモデルにおいて「出現」する
推論の転換
- 指示の従順性:入力から出力への直接的なマッピング
- コンテキスト内学習:提供された例からパターンを学ぶ(フェイショット)
- 論理的分解:問題を順次的なステップに分割する(CoT)
- プロセス監視:最終的な答えよりも「思考」のステップの正確さを優先する(OpenAI o1で見られる)
重要な洞察
フェイショットシナリオにおけるモデルのパフォーマンスは、例の数よりもラベルの分布やデモの関連性に非常に敏感である。
TERMINALbash — 80x24
> Ready. Click "Run" to execute.
>
Question 1
Which method relies on providing "demonstrations" to guide the model?
Question 2
True or False: Chain-of-Thought reasoning is a capability found in almost all AI models regardless of size.
Challenge: Optimizing Logic Puzzles
Scenario: Optimize a prompt for a model that is struggling with a logic puzzle.
You are using an LLM to solve the following puzzle: "A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost?"
Currently, you are passing the prompt exactly as written above, and the model incorrectly answers "$0.10".
Currently, you are passing the prompt exactly as written above, and the model incorrectly answers "$0.10".
Task 1
Identify if the current prompt is Zero-shot or Few-shot.
Solution:
The current prompt is Zero-shot because it provides the task description without any prior examples or demonstrations of similar solved puzzles.
The current prompt is Zero-shot because it provides the task description without any prior examples or demonstrations of similar solved puzzles.
Task 2
Inject the Zero-shot CoT trigger phrase to improve reasoning accuracy. Rewrite the prompt.
Solution:
"A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost? Let's think step by step:"
"A bat and a ball cost $1.10 in total. The bat costs $1.00 more than the ball. How much does the ball cost? Let's think step by step:"